
package com.probiz.estore.eai.customer;

import java.util.List;

import com.probiz.estore.customer.service.CustomerManager;
import com.probiz.estore.eai.common.GenericUnmarshaller;
import com.probiz.estore.eai.customer.generated.Customer;
import com.probiz.estore.eai.customer.generated.CustomerSet;

public class CustomerUnmarshaller extends
		GenericUnmarshaller<CustomerSet> {
	CustomerManager customerManager=null;
	
	public void setCustomerManager(CustomerManager customerManager) {
		this.customerManager = customerManager;
	}

	@Override
	public void startUnmarshal() throws Exception {
		
		CustomerSet customerSet = this.getEntitySet();
		List<Customer> customerList=customerSet.getCustomer();
		logger.debug("customerList size="+customerList.size());
		customerManager.doImportCustomersForEai(customerList);
	}


}
